<template>
  <el-drawer title="联系人详情" v-model="infoDrawer" :with-header="true">
    <el-row :gutter="20" style="margin: 0">
      <el-col :span="24" style="padding: 0">
        <div class="col-content">
          <div class="label-info">姓名:</div>
          <div class="content-info">
            {{ tabInfo?.contactName }}
          </div>
        </div>
      </el-col>
      <el-col :span="24" style="padding: 0">
        <div class="col-content">
          <div class="label-info">职务:</div>
          <div class="content-info">
            {{ tabInfo?.title }}
          </div>
        </div>
      </el-col>
      <el-col :span="24" style="padding: 0">
        <div class="col-content">
          <div class="label-info">电话:</div>
          <div class="content-info">
            {{ tabInfo?.phone }}
          </div>
        </div>
      </el-col>
      <el-col :span="24" style="padding: 0">
        <div class="col-content">
          <div class="label-info">地址:</div>
          <div class="content-info">
            {{ tabInfo?.address }}
          </div>
        </div>
      </el-col>
      <el-col :span="24" style="padding: 0">
        <div class="col-content">
          <div class="label-info">备注:</div>
          <div class="content-info">
            {{ tabInfo?.remark }}
          </div>
        </div>
      </el-col>
    </el-row>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="infoDrawer = false">取消</el-button>
      </span>
    </template>
  </el-drawer>
</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  const tabInfo = ref()
  const infoDrawer = ref(false)
  const show = (data) => {
    tabInfo.value = data
    infoDrawer.value = true
  }
  defineExpose({
    show,
  })
</script>

<style lang="scss" scoped>
  .col-content {
    display: flex;
    height: 100%;
    .label-info {
      display: flex;
      align-items: center;
      justify-content: end;
      color: #606266;
      font-weight: bold;
      font-size: 14px;
      background-color: #f5f7fa;
      min-width: 60px;
      border: 1px solid #ebeef5;
      padding: 10px;
      .icons {
        margin-right: 6px;
        height: 16px;
        width: 16px;
      }
    }
    .content-info {
      display: flex;
      align-items: center;
      width: 100%;
      padding: 10px;
      border: 1px solid #ebeef5;
    }
  }
</style>
